#include<iostream>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<algorithm>
using namespace std;

int main()
{
    int n,count;
    while(cin>>n)
    {   
        count=0;
        if(n==0) break;
        while(n!=1)
        {
           if(n%2==0)  n=n/2;
           else {n=n*3+1;n=n/2;}
           count++; 
        }
        cout<<count<<endl;
    }
   // system("pause");
    return 0;
}   
       
